package com.bilgeadam.jsp.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bilgeadam.jsp.model.User;

/**
 *
 * @author Bora SAYINER
 * @since Jan 4, 2015 5:13:37 PM
 * @version 1.0
 */
@WebServlet(name = "loginServlet", urlPatterns = { "/loginServlet" })
public class LoginServlet extends HttpServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String userName = req.getParameter("userName");
		User user = new User();
		user.setUserName(userName);
		req.setAttribute("user", user);
		req.getRequestDispatcher("home.jsp").forward(req, resp);
	}
}
